<template>
  <div id="app" class="zh-proview">
    <router-view/>
    <Tab-Bar v-if="$route.path !== '/login'" :tabIcon="tabIcon" @taggerNavBar="taggerNavBar"></Tab-Bar>
  </div>
</template>
<script>
export default {
  data () {
    return {
      tabIcon: [
        { key: 'Index', icon: 'icon-yemian', name: '首页' },
        { key: 'Redian', icon: 'icon-redian', name: '热点' },
        { key: 'Game', icon: 'icon-game', name: '游戏' },
        { key: 'Wode', icon: 'icon-wode', name: '我的' }
      ]
      // contentName: '首页'
    }
  },
  watch: {
    $route: 'routeChange'
  },
  methods: {
    taggerNavBar (item) {
      this.contentName = item.name
    },
    routeChange (to, from) {
      document.body.scrollTop = 0
      document.documentElement.scrollTop = 0
    }
  }
}
</script>
<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  height: 100%;
  background: #f7f8fa;
  max-width: 750px;
  margin: 0 auto;
}
.zh-proview {
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.y-scroll {
  overflow-y: scroll;
}

/*滚动条整体样式*/
.y-scroll::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

/*滚动条滑块*/
.y-scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  // -webkit-x-scroll-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  // opacity: 0;
  background: #eee;
}

/*滚动条轨道*/
.y-scroll::-webkit-scrollbar-track {
  // -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0);
  border-radius: 10px;
  opacity: 0;
}
</style>
